#ifndef __M_MESSAGE_H__
#define __M_MESSAGE_H__



#include<iostream>
#include"level.hpp"
#include"util.hpp"
#include<thread>
namespace dhylog
{
    struct LogMsg
    {
        time_t _ctime;//日志产生的时间戳
        loglevel::value _level;//日志等级
        size_t _line;//行号
        std::thread::id _tid;//线程id
        std::string _file;//源码文件名
        std::string _logger;//日志器名称
        std::string _payload;//有效消息数据

        LogMsg(loglevel::value level,
                size_t line,
                std::string file,
                std::string logger,
                std::string msg):
                _ctime(util::date::now()),
                _line(line),
                _level(level),
                _tid(std::this_thread::get_id()),
                _file(file),
                _logger(logger),
                _payload(msg) {}       
    };
}
#endif